*********************************** FOLDERS ************************************

* Define the main project path (currently an empty string, make sure to set this correctly)
global project ""

* Define paths for different data and output folders using the project path
global input "$project/data/input"       			// Path for datasets - input
global output "$project/data/output"                // Path for datasets - output
global codes "$project/codes"        				// Path for dofiles
global tables "$project/results/tables"             // Path for tables
global figures "$project/results/figures"           // Path for figures
global logs "$project/logs"           				// Path for logs

****************************** RUN CODES **************************************

************
* PROCESSING
************

// Imports admin datasets and aggregates information at the firm-level - FinTech vs bank borrowers
do "$codes\1_csv_to_dta_conversion_fin_bank.do"			
// Imports admin datasets and aggregates information at the firm-level - FinTech vs rejected borrowers
do "$codes\2_csv_to_dta_conversion_acc_rej.do" 
// Performs various propensity score matching procedures - FinTech vs bank borrowers
do "$codes\3_PSM_fin_bank.do"
// Performs propensity score matching procedures on sub-samples - FinTech vs bank borrowers - TO CHECK WITH HUAN
do "$codes\4_PSM_subsamples_acc_rej.do" 
// Performs various propensity score matching procedures - FinTech vs rejected borrowers
do "$codes\5_PSM_acc_rej.do"
// Performs propensity score matching procedures on sub-samples - FinTech vs rejected borrowers - TO CHECK WITH HUAN
do "$codes\6_PSM_subsamples_acc_rej.do"

*********
* FIGURES
*********

// Figure 1 + Figure IA C1a
do "$codes\7_trend_fintech.do"
// Figure 2a + Table 3a-3b
do "$codes\8_fin_bank_t-test.do"  
// Figure 2b + Table 3c-3d
do "$codes\9_acc_rej_t-test.do"
// Figure 3a + Figure 4a-b, left + Figure IA C2a-D2a
do "$codes\10_trends_psm_fin_bank.do"
// Figure 3b + Figure 4a-b, right + Figure IA C2b-D2b
do "$codes\11_trends_psm_acc_rej.do" 
// Figures 5a-b, left + Figure IA D1a
do "$codes\12_trends_psm_subsamples_fin_bank.do" 
// Figures 5a-b, right + Figure IA D1b
do "$codes\13_trends_psm_subsamples_acc_rej.do"
// Figure 6
do "$codes\14_outside_subsequent_loans.do" 

*********
* TABLES
*********

// Table 1 - Investors 
do "$codes\15_FinTech_loans.do" 
// Table 1 - Loans + Table 2 
do "$codes\16_FinTech_vs_bank_loans.do" 
// Table 4 col 1-2 + Table IA D1a
do "$codes\17_regressions_PSM_fin_bank.do" 
// Table 4 col 3-4 + Table IA D1b
do "$codes\18_regressions_PSM_acc_rej.do" 
// Table 5a
do "$codes\19_table_5_fin_bank.do" 
// Table 5b
do "$codes\20_table_5_acc_rej.do"
// Table 6a-b
do "$codes\21_table_6.do" 
// Table 7a
do "$codes\22_table_7_fin_bank.do" 
// Table 7b
do "$codes\23_table_7_acc_rej.do"
// Table 8a
do "$codes\24_table_8a.do"
// Table 8b 
do "$codes\25_table_8b.do" 
// Table 9a 
do "$codes\26_table_9_fin_bank.do" 
// Table 9b
do "$codes\27_table_9_acc_rej.do" 
// Table 10 col 1-2-3 + Table IA G1 col 1-2-3
do "$codes\28_table_10_fin_bank.do" 
// Table 10 col 4 + Table IA G1 col 4
do "$codes\29_table_10_acc_rej.do" 

********************
* INTERNET APPENDIX
********************

// Figure IA B1
do "$codes\30_IA_figure_b1.do" 
//Figures IA B2
do "$codes\31_IA_figure_b2.do" 
// Figure IA B3a
do "$codes\32_IA_figure_b3a.do" 
// Figure IA B3b
do "$codes\33_IA_figure_b3b.do"   
// Figure IA B3c
do "$codes\34_IA_figure_b3c.do"
// Figure IA B4a
do "$codes\35_IA_figure_B4a.do" 
// Figure IA B4b
do "$codes\36_IA_figure_B4b.do" 
// Figure IA C1b
do "$codes\37_IA_figure_C1b.do"
// Table IA E
do "$codes\38_IA_table_E1.do" 
// Figure F1
do "$codes\39_IA_table_F1.do" 
// Table IA H1
do "$codes\40_IA_table_H1.do" 
// Figures IA H1 H2
do "$codes\41_IA_early_repayers.do" 
// IA Table I1 
do "$codes\42_IA_table_I1.do" 
// Table IA I2
do "$codes\43_IA_table_I2.do"
// IRR of Fintech loans
do "$codes\44_IA_appendix_K.do"

